package com.haredot.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.haredot.entity.Message;
import com.haredot.vo.MessageVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Set;

/**
* @author Administrator
* @description 针对表【tb_message】的数据库操作Mapper
* @createDate 2023-09-12 21:52:33
* @Entity com.haredot.entity.Message
*/
@Mapper
public interface MessageMapper extends BaseMapper<Message> {

    List<MessageVo> findMessageRecordsBetweenTwoUser(@Param("offset") Long offset, @Param("rows") Long rows,
                                                     @Param("fromUser") Long fromUserId,
                                                     @Param("toUser") Long toUserId);

    int batchUpdateMessageReadStateTrue(Set<Message> messages);

    MessageVo findMessage(@Param("messageId") Long messageId);
}




